package com.movie.ticket.sale.movieinterface.aheadcontroller;


import com.movie.ticket.sale.movieinterface.aheadcontroller.movieForm.OrderSeat;
import com.movie.ticket.sale.movieinterface.common.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@Api(tags="电影方相关接口",description = "提供电影操作的API")
public class MovieDetailsController {
    //// TODO: 2020/12/3  展示电影封面
    @ApiOperation(value = "展示电影封面")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "电影名字",dataType = "String")
    })
    @GetMapping("movie/film/show/getMovieData")
    public Result getMovieData(String movieName){
        log.info("(封面)电影名称参数为：{}",movieName);
        return Result.success("电影封面地址");
    }
    //// TODO: 2020/12/3  展示电影信息(包括简介)
    @ApiOperation(value = "展示电影信息(包括简介)")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "电影名字",dataType = "String")
    })
    @GetMapping("movie/film/show/getMovieInnformention")
    public Result getMovieInnformention(String movieName){
        log.info("(信息)电影名称参数为：{}",movieName);
        return Result.success("电影信息对象");
    }
    //// TODO: 2020/12/3  展示电影评论
    @ApiOperation(value = "展示电影评论")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "电影名字",dataType = "String"),
            @ApiImplicitParam(name="currPage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name="number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("movie/film/show/getMovieCommon")
    public Result getMovieReview(String movieName,@RequestParam(defaultValue = "1")int currPage,@RequestParam(defaultValue = "5")int number){
        log.info("(评论)电影名称参数为：{}",movieName);
        return Result.success("电影评论信息");
    }
    //// TODO: 2020/12/3  展示电影演职人员
    @ApiOperation(value = "展示电影演职人员")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "电影名字",dataType = "String")
    })
    @GetMapping("movie/film/show/getMoviePerson")
    public Result getMoviePerson(String movieName){
        log.info("(演职人员)电影名称参数为：{}",movieName);
        return Result.success("演职人员对象");
    }
    //// TODO: 2020/12/3  展示电影剧照
    @ApiOperation(value = "展示电影剧照")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "电影名字",dataType = "String")
    })
    @GetMapping("movie/film/show/getMoviePhoto")
    public Result getMoviePhoto(String movieName){
        log.info("(剧照)电影名称参数为：{}",movieName);
        return Result.success("返回电影剧照的集合");
    }
    //// TODO: 2020/12/3  演职人员头像
    @ApiOperation(value = "演职人员头像")
    @GetMapping("movie/film/show/getCastPhoto")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "演员名字",dataType = "String")
    })
    public Result getCastPhoto(String castName){
        log.info("展示演职人员头像演员参数名字：{}",castName);
        return Result.success("演职人员对象");
    }
    //// TODO: 2020/12/3  演职人员介绍
    @ApiOperation(value = "演职人员介绍")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "演员名字",dataType = "String")
    })
    @GetMapping("movie/film/show/getCastIntroduce")
    public Result getCastIntroduction(String castName){
        log.info("展示演员简介参数：{}",castName);
        return Result.success("返回对应的演职人员对象");
    }
    //// TODO: 2020/12/3  演职人员参演作品
    @ApiOperation(value = "演职人员参演作品")
    @ApiImplicitParams({
            @ApiImplicitParam(name="movieName",value = "演员名字",dataType = "String"),
            @ApiImplicitParam(name="type",value = "演员（0）还是导演（1）",dataType = "String")
    })
    @GetMapping("movie/film/show/getCastInWork")
    public Result getCastInWork(String castName,int type){
        log.info("展示演员参演作品参数：{}{}",castName,type);
        return Result.success("返回演员对应的作品对象");
    }
    //// TODO: 2020/12/3  选择影院，按照区域，时间，影厅，服务筛选，默认距离最近的在前面，可调整为通过价格排序
    @ApiOperation(value = "选择影院，按照区域，时间，影厅，服务筛选，默认距离最近的在前面，可调整为通过价格排序")
    @ApiImplicitParams({
            @ApiImplicitParam(name="cinemaName",value = "电影院名字",dataType = "String"),
            @ApiImplicitParam(name="region",value = "区域",dataType = "String"),
            @ApiImplicitParam(name="showTime",value = "观影时间",dataType = "String"),
            @ApiImplicitParam(name="auditoriumType",value = "影厅类型",dataType = "String"),
            @ApiImplicitParam(name="service",value = "可提供服务类型（退票，改签，都有）",dataType = "String"),
            @ApiImplicitParam(name="currPage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name="number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("movie/film/show/chooseCinema")
    public Result chooseCinema(String cinemaName,String region,String showTime,String auditoriumType,String service,@RequestParam(defaultValue = "1")int currPage,@RequestParam(defaultValue = "5")int number){
        log.info("筛选影院参数：影院名{}区域{}时间{}影厅类型{}服务类型{}",cinemaName,region,showTime,auditoriumType,service,currPage,number);
        return Result.success("筛选出的影院对象");
    }
    //// TODO: 2020/12/3  影院详情包含影院照片，影院信息，地址信息（地图），当前影院上映列表（包含预告电影），电影信息，
    @ApiOperation(value = "影院详情包含影院照片，当前影院上映列表（包含预告电影）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cinimaName",value = "电影院名字",dataType = "String")
    })
    @GetMapping("movie/show/getCinemaMessagePicture")
    public Result getCinemaMessagePicture(String cinemaName){
        log.info("展示信息所需影院名字：{}",cinemaName);
        return Result.success("影院详情包含影院照片(地址)，影院信息，地址信息（地图）");
    }
    //// TODO: 2020/12/3  展示影院信息包括经纬度信息
    @ApiOperation(value = "影院信息，地址信息（地图），展示影院信息包括经纬度信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cinimaName",value = "电影院名字",dataType = "String")
    })
    @GetMapping("movie/show/getCinemaMessage")
    public Result getCinemaMessage(String cinemaName){
        log.info("展示信息所需影院名字：{}",cinemaName);
        return Result.success("影院详情包含影院信息，地址信息（地图经纬度）");
    }
    //// TODO: 2020/12/3  当前影院上映列表（包含预告电影）
    @ApiOperation(value = "当前影院上映列表（包含预告电影）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cinimaName",value = "电影院名字",dataType = "String")
    })
    @GetMapping("movie/show/getCinemaAdvance")
    public Result getCinemaAdvance(String cinemaName){
        log.info("展示信息所需影院名字：{}",cinemaName);
        return Result.success("展示当前影院正在热映或者预告的影片");
    }
    //// TODO: 2020/12/3  展示当前影院影厅排片信息
    @ApiOperation(value = "展示当前影院影厅排片信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cinimaName",value = "电影院名字",dataType = "String"),
            @ApiImplicitParam(name = "movieName",value = "电影名字",dataType = "String")
    })
    @GetMapping("movie/show/getCinemaSchedule")
    public Result getCinemaSchedule(String cinemaName,String movieName){
        log.info("展示信息排片信息所需影院名字和电影名：{}{}",cinemaName,movieName);
        return Result.success("展示当前影院的用户点击的影片的排片信息表");
    }
    //************************************进入选座界面*************************************************
    // TODO: 2020/12/3 获取用户所选择的座位信息
    @ApiOperation(value = "下单的座位信息,并发送手机短信验证码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderSeat",value = "下单的座位信息和用户手机号")
    })
    @PostMapping("movie/add/addSeat")
    public Result addSeat(@ModelAttribute OrderSeat orderSeat){
        log.info("传入的座位信息为：{}",orderSeat);
        return Result.success("下单成功");
    }
    // TODO: 2020/12/3 座位选取的旁边展示影片信息
    @ApiOperation(value = "座位选取的旁边展示影片信息 ")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cinimaName",value = "电影院名字",dataType = "String"),
            @ApiImplicitParam(name = "auditoriumName",value = "电影院影厅名字",dataType = "String")
    })
    @GetMapping("movie/show/getInformentionOfMovie")
    public Result getInformentionOfMovie(String cinimaName,String auditoriumName){
        log.info("影片影院展示参数：{}{}",cinimaName,auditoriumName);
        return Result.success("返回一个包含所有信息影片影厅的对象");
    }
    //**********************************************支付接口*****************************************************
    //暂无，调取接口需传入
    //**********************************************支付接口*****************************************************
    // TODO: 2020/12/4  通过输入的影片名模糊查询，再进行分页渲染
    @ApiOperation(value = "通过输入的影片名模糊查询，再进行分页渲染")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "movieName",value = "电影名",dataType = "String"),
            @ApiImplicitParam(name = "currpage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("movie/show/getMovieByMovieName")
    public Result getMovieByMovieName(String movieName,@RequestParam(defaultValue = "1")int currpage,@RequestParam(defaultValue = "5")int number){
        log.info("分页模糊查询:{}{}{}",movieName,currpage,number);

        return Result.success("电影的对象");
    }

    // TODO: 2020/12/4  通过输入的影人名模糊查询，再进行分页渲染
    @ApiOperation(value = "通过输入的影人名模糊查询，再进行分页渲染")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "peopleName",value = "影人名",dataType = "String"),
            @ApiImplicitParam(name = "currpage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("movie/show/getMovieByPeopleName")
    public Result getMovieByPeopleName(String peopleName,@RequestParam(defaultValue = "1")int currpage,@RequestParam(defaultValue = "5")int number){
        log.info("分页模糊查询:{}{}{}",peopleName,currpage,number);

        return Result.success("影人的对象");
    }

    // TODO: 2020/12/4  通过输入的影院名模糊查询，再进行分页渲染
    @ApiOperation(value = "通过输入的影院名模糊查询，再进行分页渲染")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cenimaName",value = "影院名",dataType = "String"),
            @ApiImplicitParam(name = "currpage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("movie/show/getMovieByCinemaName")
    public Result getMovieByCinemaName(String cenimaName,@RequestParam(defaultValue = "1")int currpage,@RequestParam(defaultValue = "5")int number){
        log.info("分页模糊查询:{}{}{}",cenimaName,currpage,number);

        return Result.success("影人的对象");
    }

    // TODO: 2020/12/4根据电影类型，国家，年代进行动态筛选,并分页展示
    @ApiOperation(value = "根据电影类型，国家，年代进行动态筛选,并分页展示")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "movieType",value = "电影类型",dataType = "String"),
            @ApiImplicitParam(name = "MovieAddress",value = "国家",dataType = "String"),
            @ApiImplicitParam(name = "MovieTime",value = "年代",dataType = "String"),
            @ApiImplicitParam(name = "currpage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("movie/show/getMovieByTypeAddressTime")
    public Result getMovieByTypeAddressTime(String movieType,String MovieAddress,String MovieTime,@RequestParam(defaultValue = "1")int currpage,@RequestParam(defaultValue = "5")int number){
        log.info("筛选电影参数{}{}{}{}{}",movieType,MovieAddress,MovieTime,currpage,number);
        return Result.success("电影对象");
    }
}
